/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pio.action.preinscrito;

//import DB_OBSOLETA.AspiranteFormDB;
import DBMS.DataBaseManager;
import clases.Carrera;
import clases.Preinscrito;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

/**
 *
 * @author charles
 */
public class Modificar extends DispatchAction {

    /* forward name="success" path="" */
    private static final String SUCCESS = "success";
    private static final String FAILURE = "failure";

    
//    public ActionForward update(ActionMapping mapping, ActionForm form,
//            HttpServletRequest request, HttpServletResponse response)
//            throws Exception {
//        Preinscrito p = (Preinscrito) form;
//        DataBaseManager dbms = DataBaseManager.getInstance();
//        boolean modificado = dbms.modificarPreinscrito(p);
//        if (modificado) {
//            return mapping.findForward(SUCCESS);
//        } else {
//            return mapping.findForward(FAILURE);
//        }
//    }
//    
//    public ActionForward populate(ActionMapping mapping, ActionForm form,
//            HttpServletRequest request, HttpServletResponse response)
//            throws Exception {
//        Preinscrito p = (Preinscrito) form;
//        String cedula = (String)request.getSession().getAttribute("cedula");
//        DataBaseManager dbms = DataBaseManager.getInstance();
//        boolean encontrado = dbms.llenarPreinscrito(cedula, p);
//        if (encontrado) {
//            request.setAttribute("carreras", Carrera.getAll());
//            return mapping.findForward(SUCCESS);
//        } else {
//            return mapping.findForward(FAILURE);
//        }
//    }
}
